package com.xinqi.modules.exam.paper.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 测评状态枚举，1-未发布 2-定时发布  3-已开始 4-已结束 5-已发布
 *
 * @author linkai
 * @date 2023/7/2
 */
public enum ExamStatusEnum implements BaseEnum {
    草稿("1", "草稿"),
    定时发布("2", "定时发布"),
    已开始("3", "已开始"),
    已结束("4", "已结束"),
    已发布("5", "已发布"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    ExamStatusEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static ExamStatusEnum of(String code) {
        return BaseEnum.of(ExamStatusEnum.class, code);
    }
}
